<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<title></title>
<meta name="keywords" content="">
<meta name="description" content="">
</head>

<body class="signin">
  <div class="signinpanel">
    <div class="row">
      <div class="col-sm-7">
        <div class="signin-info">
          <div class="logopanel m-b">
            <h1></h1>
          </div>
          <div class="m-b"></div>
          <h3></h3>
        </div>
      </div>
      <div class="col-sm-5">
        <form id="signupForm">
          <h3 class="text-center">用户登录</h3>
          <p class="m-t-md text-center">欢迎登录</p>
          <input type="text" name="username" class="form-control uname" />
          <p>
            <input type="hidden" name="service" th:value="${service}" />
          <p>
            <input type="password" name="password" th:value="${password}" />
          <p>
            <a id="login" class="btn btn-login btn-block" onclick="login();">登录</a>
          <div class="outside-login"></div>
        </form>
      </div>
    </div>
    <div class="signup-footer">
      <div class="pull-left">&copy; 2020 All Rights Reserved. IVDDC</div>
    </div>
  </div>
  <script th:inline="javascript"> var ctx = [[@{/}]] ; </script>
  <!-- 全局js -->
  <script src="/js/jquery.min.js?v=2.1.4" th:src="@{/js/jquery.min.js?v=2.1.4}"></script>
  <script src="/js/bootstrap.min.js?v=3.3.6" th:src="@{/js/bootstrap.min.js?v=3.3.6}"></script>

<!-- jQuery Validation plugin javascript-->
<script type="text/javascript">
function login() {
    $.ajax({
        type: "POST",
        url: ctx+"login",
        data: $('#signupForm').serialize(),
        success: function (r) {
            if (r.code == 0) {
				window.location.href = r.service;
            } else {
                alert(r.msg);
            }
        },
    });
}
</script>
</body>
</html>
